<%@page import="org.hibernate.validator.constraints.SafeHtml.Tag"%>
<%@ page import="cn.fl.framework.base.context.CurrentThreadContext" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>项目产品详情</title>
	<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<div>
		<input id="prdmarks" value="" style="display:none"/>
		<div id="pageInTab" class="pageInTab">
			<form id="basePrdForm1">
				<div tabid="tabA" title="产品基本信息" lselected="true">
					<div class="fieldset1 tabel_col clearFix">
						<div class="caption">
							<span class="title">主车配置</span>
						</div>
						<div style="display: none">
							<input name="mfrId" id="mfrId" type="text"  value=""  class="ui-textbox"  disabled="disabled">
							<input name="mfrNm" id="mfrNm" type="text"  value=""  class="ui-textbox"  disabled="disabled">
							<input name="brCd" id="brCd" type="text"  value=""  class="ui-textbox"  disabled="disabled">
							<input name="prdbscInfoId" id="prdbscInfoId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="carId" id="carId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="tkId" id="tkId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="prdId" id="prdId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="prdDtlId" id="prdDtlId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="removeFlag" id="removeFlag"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="styleId" id="styleId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
                            <input name="carSourceId" id="carSourceId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">


						</div>
						<div class="fieldBox col_33" >
							<div class="label">产品名称</div>
							<div class="field">
								<input name="prdNm"  id="prdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">产品类型</div>
							<div class="field">
								<input name="prdTypCdNm" id="prdTypCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
								<input name="prdTypCd" id="prdTypCd" type="hidden"  value=""  class="ui-textbox"  >
								<input name="prdCd" id="prdCd" type="hidden"  value=""  class="ui-textbox"  >
							</div>
						</div>


						<div class="fieldBox col_33" >
							<div class="label">车辆型号</div>
							<div class="field">
								<input name="prdMdl" id="prdMdl" type="text"  value=""  class="ui-textbox" readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_66" >
							<div class="label">车型名称</div>
							<div class="field">
								<input name="carStyleName" id="carStyleName" type="text"  value="${prdBscInfoVO.carStyleName }"  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" id="isTk">
							<div class="label">车型</div>
							<div class="field">
								<input name="prdMdlSun" id="prdMdlSun" type="text"  value=""  class="ui-textbox" readonly="readonly">
							</div>
						</div>

						<div class="fieldBox col_33" >
							<div class="label">产品品牌</div>
							<div class="field">
								<input name="brCdNm" id="brCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">车系</div>
							<div class="field">
								<input name="modelNm" id="modelNm" type="text"  value="${prdBscInfoVO.modelNm }"  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">生产集团</div>
							<div class="field">
								<input name="productionCompany" id="productionCompany" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div id="tkOption" style ="display: none">
							<div class="fieldBox col_33">
								<div class="label">品牌类别</div>
								<div class="field">
									<select id="brTypCd" name="brTypCd" readonly="readonly">
										<c:forEach items="${brTypCdList}" var="brType">
											<option value="${brType.key }">${brType.value }</option>
										</c:forEach>
									</select>
								</div>
							</div>

						</div>
						<div class="fieldBox col_33"  id="licenseCdDiv"  style="display: none">
							<div class="label">牌照类别</div>
							<div class="field">
								<select id="licenseCd" name="licenseCd" readonly="readonly">
									<c:forEach items="${licenseCdList}" var="license">
										<option value="${license.key }">${license.value }</option>
									</c:forEach>
								</select>
								<span class="requiredSymbol"  id="licenseCdTxt" style="display: none">*</span>
							</div>
						</div>

						<jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddDynamicPage.jsp"></jsp:include>
						<div class="fieldBox col_33">
							<div class="label">是否新产品</div>
							<div class="field">
								<select id="isNew" name="isNew" onchange="setUsedPdShow()">
									<c:forEach items="${yesNoCdList}" var="yesFlag">
										<option value="${yesFlag.key }">${yesFlag.value }</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<c:if test="${buOrgCd == '00000013' && prjTypCd=='CPYW'}">
							<div class="fieldBox col_33">
								<div class="label">是否预上牌</div>
								<div class="field">
									<select name="isAdvLic" id="isAdvLic" data-value=" " validate="{required:true}"  onchange="setAdvLicTmShow()">
										<option value=" " selected="selected">--请选择--</option>
										<option value="1" <c:if test="${prdBscInfoVO.isAdvLic == 1}">selected</c:if>>是</option>
										<option value="0" <c:if test="${prdBscInfoVO.isAdvLic == 0}">selected</c:if>>否</option>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33" id="advLicTmDiv">
								<div class="label">预上牌时间</div>
								<div class="field">
									<input name="advLicTm" id="advLicTm" type="text" class="ui-datepicker" value="" >
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</c:if>
						<!-- 二手设备附加项 -->
						<div class="fieldBox col_100">
							<span style="color: red; display: none" id="SecondPrdText" >二手设备附加项</span>
						</div>
						<div id="SecondPrd"  style="display: none">
							<jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddSecDynamicPage.jsp"></jsp:include>
                            <div class="fieldBox col_33" >
                                <div class="label">变速箱品牌</div>
                                <div class="field">
                                    <input name="gerrBoxBrand" id="gerrBoxBrand" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">发动机品牌</div>
                                <div class="field">
                                    <input name="styleEngine" id="styleEngine" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">出厂日期</div>
                                <div class="field">
                                    <input name="releaseDate" id="releaseDate" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">车辆停放地</div>
                                <div class="field">
                                    <input name="parkingLot" id="parkingLot" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">车辆等级</div>
                                <div class="field">
                                    <input name="classNm" id="classNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">评估师</div>
                                <div class="field">
                                    <input name="surveyorNm" id="surveyorNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">车源网估值</div>
                                <div class="field">
                                    <input name="vehValNew" id="vehValNew" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
                            <div class="fieldBox col_33" >
                                <div class="label">估值时间差</div>
                                <div class="field">
                                    <input name="timeDiff" id="timeDiff" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
                            <div class="fieldBox col_33" >
                            <div class="label">浮动比例</div>
                            <div class="field">
                                <input name="floatPct" id="floatPct" type="text"  value="0"  class="ui-textbox"  readonly="readonly">
                            </div>
                        </div>
                            <div class="fieldBox col_33" >
                                <div class="label">车源编号</div>
                                <div class="field">
                                    <input name="carNo" id="carNo" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
							<div class="fieldBox col_33" >
								<div class="label">可贷金额</div>
								<div class="field">
									<input name="loanableAmt" id="loanableAmt" type="text"  value=""  class="ui-textbox"  readonly="readonly">
								</div>
							</div>
							<div class="fieldBox col_33" >
								<div class="label">行驶里程</div>
								<div class="field">
									<input name="tvlMil" id="tvlMil" type="text"  value=""  class="ui-textbox"  readonly="readonly">
								</div>
							</div>
						</div>
						<div class="caption" >
							<span class="title">上装配置</span>
						</div>
						<jsp:include page="../prjprdbscinfo/projectPrdDetailDynamicPage.jsp"></jsp:include>
						<div class="caption">
							<span class="title">项目相关信息</span>
						</div>
						<c:if test="${prjTypCd != 'CDDYWYQ'}">
							<div class="fieldBox col_33">
								<div class="label">参考价（元）</div>
								<div class="field">
									<c:if test="${fromCddFlag==1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value="${prdBscInfoVO.guidePc }"   onchange="guidePcChange()" validate="{number: true,required:true}"/>
									</c:if>
									<c:if test="${fromCddFlag!=1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value=""   onchange="guidePcChange()" validate="{number: true,required:true}"/>
									</c:if>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</c:if>
						<%--<c:if test="${prjTypCd == 'CDDYWYQ'}">
							<div class="fieldBox col_33" aria-readonly="true">
								<div class="label">参考价（元）</div>
								<div class="field" aria-readonly="true">
									<c:if test="${fromCddFlag==1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value="${prdBscInfoVO.guidePc }"   onchange="guidePcChange()" validate="{number: true,required:true}" readonly/>
									</c:if>
									<c:if test="${fromCddFlag!=1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value=""   onchange="guidePcChange()" validate="{number: true,required:true}" readonly/>
									</c:if>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</c:if>--%>
						<div class="fieldBox col_33">
							<div class="label">数量</div>
							<div class="field">
								<input id="prdQty" name="prdQty" type="text"  class="ui-textbox"  value="${prdQty}" onchange="guidePcChange()" validate="{number: true,required:true}"/>
								<span class="requiredSymbol">*</span>
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">设备款合计（元）</div>
							<div class="field">
								<input id="prdAmt" name="prdAmt" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
							</div>
						</div>
						<div class="fieldBox col_100"  id="guideMsgDiv" style="display: none">
							<div class="label">注意事项：</div>
							<div class="field">
								<span style="color: red"> 包牌项目请在参考价填入包牌价格</span>
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">每台设备留购价（元）</div>
							<div class="field">
								<c:if test="${prjTypCd != 'CDDYWYQ'}">
									<input id="rsrvPc" name="rsrvPc" type="text" onblur="checkAmt();" class="ui-textbox"  value="" validate="{number: true,required:true}"/>
								</c:if>
								<%--<c:if test="${prjTypCd == 'CDDYWYQ'}">
									<input id="rsrvPc" name="rsrvPc" type="text" class="ui-textbox"  value="0" validate="{number: true,required:true}" readonly/>
								</c:if>--%>
								<span class="requiredSymbol">*</span>
							</div>
						</div>
                        <div class="fieldBox col_33" id="vehValDiv" style="display: none">
                            <div class="label">车辆估值(元)</div>
                            <div class="field">
								<input id="vehVal" name="vehVal" type="text"  disabled="disabled"  class="ui-textbox"  value="" />
								<span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <div class="fieldBox col_33"   id="custFinaDiv" style="display: none">
                            <div class="label">客户融资金额</div>
                            <div class="field">
                                <input id="custFina" name="custFina" type="text"    class="ui-textbox"  value="" />
                            </div>
                        </div>
						<div class="fieldBox col_33" id="irrPctText">
							<div class="label">实际收益率</div>
							<div class="field">
								<input id="irrPct" name="irrPct" type="text"  class="ui-textbox"  value="" validate="{number: true}"/>%
							</div>
						</div>
                        <c:if test="${prjTypCd != 'CDDYWYQ'}">
                            <div class="fieldBox col_33">
                                <div class="label">收款方类型</div>
                                <div class="field">
                                    <select id="receiveTypeCd" name="receiveTypeCd">
                                        <c:forEach items="${receiveTypeCdList}" var="rtc">
                                            <option value="${rtc.key }">${rtc.value }</option>
                                        </c:forEach>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>
                        <%--<c:if test="${prjTypCd == 'CDDYWYQ'}">
                            <div class="fieldBox col_33">
                                <div class="label">收款方类型</div>
                                <div class="field">
                                    <span>承租人</span>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>--%>
                        <c:if test="${prjTypCd != 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splOwner">
                                <div class="label">收款方</div>
                                <div class="field">
									<input name="splId" id="splId" type="hidden" class="ui-textbox" value="${splId}"
										   readonly="readonly">
									<input name="splNm" id="splNm" type="text" class="ui-textbox" value="${splNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
<%--                                    <div class="combo_itemList_wrap"></div>--%>
                                </div>
                            </div>
							<%-- receiveTypeCd != 1时展示 --%>
                            <div class="fieldBox col_50" id="cstOwner" style="display: none">
                                <div class="label">收款方</div>
                                <div class="field">
                                    <input name="cstSplId"  id="cstSplId" type="hidden" class="ui-textbox" value="${splId}"
										   readonly="readonly">
									<input name="cstSplNm" id="cstSplNm" type="text" class="ui-textbox" value="${splNm}"
										   readonly="readonly">
                                    <span class="requiredSymbol">*</span>
<%--                                    <div class="combo_itemList_wrap"></div>--%>
                                </div>
                            </div>
                        </c:if>
                       <%-- <c:if test="${prjTypCd == 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splOwner">
                                <div class="label">收款方</div>
                                <div class="field">
                                    <select id="yqCstSplId" name="yqCstSplId">
                                        <c:forEach items="${yqCstIdList}" var="yqCstIdList">
                                            <option value="${yqCstIdList.cstId}">${yqCstIdList.cstNm}</option>
                                        </c:forEach>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>--%>
						<!-- 供应商ID -->
                        <c:if test="${prjTypCd != 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splAccNo">
                                <div class="label">收款账号</div>
								<div class="field">
									<input name="splAccNoId" id="splAccNoId" type="hidden" class="ui-textbox"
										   value="${accId}"  readonly="readonly">
									<input name="splAccNoNm" id="splAccNoNm" type="text" class="ui-textbox"
										   value="${accNo}"  readonly="readonly">
									<span class="requiredSymbol">*</span>
										<%--                                    <div class="combo_itemList_wrap"></div>--%>
								</div>
                            </div>
							<%-- receiveTypeCd != 1时展示 --%>
                            <div class="fieldBox col_50" id="cstAccNo" style="display: none">
                                <div class="label">收款账号</div>
                                <div class="field">
                                    <input name="cstSplAccNoId"  id="cstSplAccNoId" type="hidden" class="ui-textbox" value="${accId}"
										   readonly="readonly">
									<input name="cstSplAccNoNm" id="cstSplAccNoNm" type="text" class="ui-textbox" value="${accNo}"
										   readonly="readonly">
                                    <span class="requiredSymbol">*</span>
<%--                                    <div class="combo_itemList_wrap"></div>--%>
                                </div>
                            </div>
                        </c:if>
                        <%--<c:if test="${prjTypCd == 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splAccNo">
                                <div class="label">收款账号</div>
                                <div class="field">
                                    <select id="yqSplAccNoId" name="yqSplAccNoId">
										<option value="  "></option>
                                        <c:forEach items="${yqAccNoList}" var="yqAccNoList">
										<option <c:if test="${yqBankId == yqAccNoList.key}" >selected</c:if>
													value="${yqAccNoList.key}">${yqAccNoList.value}</option>
                                        </c:forEach>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>--%>
						<!-- 供应商厂商信息 -->
						<c:if test="${(prjTypCd=='CPYW' && isSplMfr == 1) || (prjTypCd=='CTYW' && isSplMfr == 1) || (prjTypCd=='DSFZGCT' && isSplMfr == 1) || (prjTypCd=='DSFZGCP' && isSplMfr == 1)}">
							<div class="fieldBox col_100">
								<div class="label">厂商</div>
								<div class="field">
									<input name="splMfrId" id="splMfrId" type="hidden" class="ui-textbox" value="${splMfrId}"
										   readonly="readonly">
									<input name="splMfrNm" id="splMfrNm" type="text" class="ui-textbox" value="${splMfrNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
<%--									<div class="combo_itemList_wrap"></div>--%>
								</div>
							</div>
						</c:if>
						<%--<c:if test="${prjTypCd == 'CDDYWYQ'}">
							<div class="fieldBox col_50" id="isHaveBckNo">
								<div class="label">是否有供应商返利账号</div>
								<div class="field">
									<span>否</span>
								</div>
							</div>
						</c:if>--%>
						<c:if test="${prjTypCd != 'CDDYWYQ'}">
							<div class="fieldBox col_50" id="isHaveBckNo" style="display: none">
								<div class="label">是否有供应商返利账号</div>
								<div class="field">
									<select id="isBckNo" name="isBckNo" onchange="setSplBackBankShow()">
										<option value="">--请选择--</option>
										<c:forEach items="${yesNoCdList}" var="yesFlag">
											<option value="${yesFlag.key }"
													<c:if test="${hasSplBackNo==yesFlag.key}">
														selected="selected"
													</c:if>
											>${yesFlag.value }</option>
										</c:forEach>
									</select>
								</div>
							</div>
						<!-- 供应商返利ID -->
							<div class="fieldBox col_50"  id="splBckBankAccDiv"  style="display: none">
								<div class="label">供应商返利账号</div>
								<div class="field">
									<input name="splBackBankNoId"  id="splBackBankNoId" type="hidden" class="ui-textbox" value="${backAccId}"
										   readonly="readonly">
									<input name="splBackBankNoNm" id="splBackBankNoNm" type="text" class="ui-textbox" value="${backAccNo}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
<%--									<div class="combo_itemList_wrap"></div>--%>
								</div>
							</div>
						</c:if>

						<div class="fieldBox col_50" id="isHaveSalBckNo" >
							<div class="label">是否有销售返利账号</div>
							<div class="field">
								<select id="isSalBckNo" name="isSalBckNo" onchange="setSalBackBankShow()">
									<option value="">--请选择--</option>
									<c:forEach items="${yesNoCdList}" var="yesFlag">
										<option value="${yesFlag.key }"
												<c:if test="${hasSalBackNo==yesFlag.key}">
													selected="selected"
												</c:if>
										>${yesFlag.value }</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<!-- 供应商销售返利ID -->
						<c:if test="${prjTypCd != 'CDDYWYQ'}">
							<div class="fieldBox col_50"  id="salBckBankAccDiv"  style="display: none">
								<div class="label">销售返利账号</div>
								<div class="field">
									<input name="salBackBankNoId"  id="salBackBankNoId" type="hidden" class="ui-textbox" value="${salBackAccId}"
										   readonly="readonly">
									<input name="salBackBankNoNm" id="salBackBankNoNm" type="text" class="ui-textbox" value="${salBackAccNo}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
<%--									<div class="combo_itemList_wrap"></div>--%>
								</div>
							</div>
						</c:if>
						<div class="fieldBox col_100"  id="msgDiv" style="display: none">
							<div class="label">注意事项：</div>
							<div class="field">
								<span style="color: red">销售返利投放后存在无法撤回风险，请在选择收款方账号信息时注意账号选择是否正确！若因账号选择或维护错误导致付错款，业务经理自行承担返利损失！</span>
							</div>
						</div>
						<c:if test="${buOrgCd =='00000001'}">
							<div class="fieldBox col_50" id="recommendSplOwner">
								<div class="label">推荐经销商</div>
								<div class="field">
									<input name="recommendSplId"  id="recommendSplId" type="hidden" class="ui-textbox" value="${recommendSplId}"
										   readonly="readonly">
									<input name="recommendSplNm" id="recommendSplNm" type="text" class="ui-textbox" value="${recommendSplNm}"
										   readonly="readonly">
<%--									<span class="requiredSymbol">*</span>--%>
<%--									<div class="combo_itemList_wrap"></div>--%>
								</div>
							</div>
						</c:if>
						<div id ="guaranteePaymentInfo" style="display: none">
							<div class="caption">
								<span class="title">担保主体信息</span>
							</div>
							<div class="fieldBox col_50">
								<div class="label">渠道担保支付主体类型</div>
								<div class="field">
									<input name="guaranteePaymentType" id="guaranteePaymentType" type="hidden"
										   class="ui-textbox" value="${guaranteePaymentType}"
										   readonly="readonly">
									<input name="guaranteePaymentTypeNm" id="guaranteePaymentTypeNm" type="text"
										   class="ui-textbox" value="${guaranteePaymentTypeNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">渠道担保支付主体名称</div>
								<div class="field">
									<input name="guaranteePaymentNm" id="guaranteePaymentNm" type="text"
										   class="ui-textbox" value="${guaranteePaymentNm}"
										   readonly="readonly">
									<input name="guaranteePaymentId" id="guaranteePaymentId" type="text"
										   class="ui-textbox" value="${guaranteePaymentId}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</div>
						<div id="compensatorySplInfo" style="display: none">
							<div class="caption">
								<span class="title">代偿担保账号信息</span>
							</div>
							<div class="fieldBox col_50" id="compensatorySplAccNo">
								<div class="label">支付账号</div>
								<div class="field">
									<input name="compensatorySplAccNoId" id="compensatorySplAccNoId" type="hidden"
										   class="ui-textbox" value="${compensatorySplAccNoId}"
										   readonly="readonly">
									<input name="compensatorySplAccNoNm" id="compensatorySplAccNoNm" type="text"
										   class="ui-textbox" value="${compensatorySplAccNoNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">支付账户</div>
								<div class="field">
									<input name="compensatorySplRcptUnt" id="compensatorySplRcptUnt" type="text"
										   class="ui-textbox" value="${compensatorySplRcptUnt}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">开户行</div>
								<div class="field">
									<input name="compensatorySplBkNm" id="compensatorySplBkNm" type="text"
										   class="ui-textbox" value="${compensatorySplBkNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">行号</div>
								<div class="field">
									<input name="compensatorySplBkNo" id="compensatorySplBkNo" type="text"
										   class="ui-textbox" value="${compensatorySplBkNo}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</div>
						<div id="depositSplInfo" style="display: none">
							<div class="caption">
								<span class="title">保证金担保账号信息</span>
							</div>
							<div class="fieldBox col_50" id="depositSplAccNo">
								<div class="label">支付账号</div>
								<div class="field">
									<input name="depositSplAccNoId" id="depositSplAccNoId" type="hidden"
										   class="ui-textbox" value="${depositSplAccNoId}"
										   readonly="readonly">
									<input name="depositSplAccNoNm" id="depositSplAccNoNm" type="text"
										   class="ui-textbox" value="${depositSplAccNoNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">支付账户</div>
								<div class="field">
									<input name="depositSplRcptUnt" id="depositSplRcptUnt" type="text"
										   class="ui-textbox" value="${depositSplRcptUnt}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">开户行</div>
								<div class="field">
									<input name="depositSplBkNm" id="depositSplBkNm" type="text"
										   class="ui-textbox" value="${depositSplBkNm}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">行号</div>
								<div class="field">
									<input name="depositSplBkNo" id="depositSplBkNo" type="text"
										   class="ui-textbox" value="${depositSplBkNo}"
										   readonly="readonly">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>

			<div id="btnsBox" class="btnsBox">
                <span id="saveBtn" class="sq-button sq-button-round" onclick="savePrjBscInfo()">保存</span>
                <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()">取消</span>
			</div>
			</form>
		</div>
	</div>
</div>


<script type="text/javascript">
	var guidePcEditFlag = "${guidePcEditFlag}";//参考价是否可编辑标志 0-否,1-是
    var mfrGuidePcShowFlag = '${mfrGuidePcShowFlag}'; //产品明细页面厂商指导价展示标志 0-不展示,1-展示
    console.log("车辆参考价是否可编辑标志 >>" + guidePcEditFlag);
    console.log("厂商指导价展示标志 >>" + mfrGuidePcShowFlag);
    var prjId="${prjId}";
    var prdDetailId="${prdDetailId}";
    var detailFlag = '${detailFlag}';
    var splBanNo = '${splBanNo}';
    var salBanNo = '${salBanNo}';
    var id="${id}";
    var beforePrdQty = '';
    var beforeGuidePc = '';
    var beforeRsrvPc = '';
    var beforeVehVal = '';
    var beforeCustFina = '';
	var searchSplNm = '';
	var bizCd = "${bizCd}";
	var buOrgCd = '${buOrgCd}';
	var prjTypCd = '${prjTypCd}';//项目类型
	var insCode = '${insCode}';//机构代码
	var hasSplBackNo = ${hasSplBackNo};
	var hasSalBackNo = ${hasSalBackNo};
	var hasBackNoFlag =  ${hasBackNoFlag};
	var _rcCstBscInfoId = '';
	var plcyTcode = '${plcyTcode}';
	var prdTypCd = '${prdTypCd}';
	var prdCd = '${prdCd}';//二级分类
	var hasAccNoFlag = ${hasAccNoFlag};
	var isSplMfr = '${isSplMfr}';
	var COMBO_BANK;
	var insRoutePrdId='${insRoutePrdId}';
    var isDetail = '${isDetail}';
	var paySchId = '${paySchId}';
	var paySchNo = '${paySchNo}';
	var oldDtlId = '${oldDtlId}';
	var isCanEditRecommendSpl = '${isCanEditRecommendSpl}';
	$("#receiveTypeCd").val("${receiveTypeCd}");
	var insGuidPc = '${insGuidPc}';
	var compensatoryType = '${compensatoryType}';
	var guaranteePaymentType = '${guaranteePaymentType}';
	console.log(compensatoryType + 'compensatoryType');
	console.log(guaranteePaymentType + 'guaranteePaymentType');
	$(function () {
		/*if (${prjTypCd == 'CDDYWYQ'}) {
			if(detailFlag=="true") {
				// 先空着保存和取消按钮
				$("#saveBtn").hide();
				$("#cancelBtn").hide();
				$("#basePrdForm1").attr("readOnly", true);
			}
			$("#prdQty").val("1");
			$("#prdQty").attr("readOnly", true);
		}*/
		initMfrComboBox();
		var basePrdForm1 = liger.get("basePrdForm1");
		var form = $("#basePrdForm1").ligerForm({
			validate: true
		});
		$("#basePrdForm1").check_ligerFormEditor();
		initData();
		if(bizCd == "008001" || bizCd == "008004"){
			if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
				liger.get("carLen").setDisabled(true);
			}
			if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
				liger.get("powerTypCd").setDisabled(true);
			}
		}
		var receiveTypeCd = $("#receiveTypeCd").val();
		if (receiveTypeCd != ProjectConstant.RECEIVE_TYPE_CD_SPL) {//经销商
			getCstInfoList();
			getCstBankInfoList();
			$("#isBckNo").val('0');
			$("#splBackBankNoId").val("");
			$("#splOwner").hide();
			$("#cstOwner").show();
			$("#splAccNo").hide();
			$("#cstAccNo").show();
		} else {
			$("#splOwner").show();
			$("#cstOwner").hide();
			$("#isHaveBckNo").show();
			$("#splAccNo").show();
			$("#cstAccNo").hide();
		}
		if (compensatoryType == '1' || compensatoryType == '2') {
			$('#guaranteePaymentInfo').show();
		}
		if (compensatoryType == '1') {
			$('#compensatorySplInfo').show();
		}
		if (compensatoryType == '2') {
			$('#depositSplInfo').show();
		}
        if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_ESC||prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL||prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD){
            liger.get("isNew").setValue("0");
            //设置不可选
            var slt=liger.get("isNew");
            slt.setDisabled(true);
            setUsedPdShow();
            $("#isNew").hide();
        }
		//收款方类型
		$("#receiveTypeCd").change(function () {
			var receiveTypeCd = $("#receiveTypeCd").val();
			COMBO_CST.setInputValue("", "", true);
			if(receiveTypeCd!=ProjectConstant.RECEIVE_TYPE_CD_SPL){//经销商
				getCstInfoList();
				getCstBankInfoList();
				$("#isHaveBckNo").hide();
				$("#isBckNo").val('0');
				$("#splBackBankNoId").val("");
				$("#splOwner").hide();
				$("#cstOwner").show();
				$("#splAccNo").hide();
				$("#cstAccNo").show();
			}else{
				$("#splOwner").show();
				$("#cstOwner").hide();
				$("#isHaveBckNo").show();
				$("#splAccNo").show();
				$("#cstAccNo").hide();
			}
		});

		//设置影响产品价格的字段为不可修改
		if(liger.get("emiStdCd")&&liger.get("emiStdCd")!="undefined"){
			liger.get("emiStdCd").setDisabled(true);
		}
		if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
			liger.get("prdClsCd").setDisabled(true);
		}
		if(liger.get("drvTyp")&&liger.get("drvTyp")!="undefined"){
			liger.get("drvTyp").setDisabled(true);
		}
		if(liger.get("engMdl")&&liger.get("engMdl")!="undefined"){
			liger.get("engMdl").setDisabled(true);
		}

		if(liger.get("prdLvlCd")&&liger.get("prdLvlCd")!="undefined"){
			liger.get("prdLvlCd").setDisabled(true);
		}
		if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_CAR){
			//汽车金融事业部隐藏保险购买方式、实际收益率
			$("#irrPctText").hide();
			$("#buyWayCdText").hide();
		}else{
			$("#irrPctText").show();
			$("#buyWayCdText").show();
		}
		if(detailFlag=="true"){
			$("#saveBtn").hide();
			$("#cancelBtn").hide();
			$("#addBtnSpl").hide();

            if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
                liger.get("prdMdl").setDisabled(true);
            }
            if(liger.get("prdNm")&&liger.get("prdNm")!="undefined"){
                liger.get("prdNm").setDisabled(true);
            }
            if(liger.get("prdTypCdNm")&&liger.get("prdTypCdNm")!="undefined"){
                liger.get("prdTypCdNm").setDisabled(true);
            }
            if(liger.get("brCdNm")&&liger.get("brCdNm")!="undefined"){
                liger.get("brCdNm").setDisabled(true);
            }
            if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
                liger.get("buyWayCd").setDisabled(true);
            }
            if(liger.get("splMfrId")&&liger.get("splMfrId")!="undefined"){
                liger.get("splMfrId").setDisabled(true);
            }
            if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
                liger.get("splAccNoId").setDisabled(true);
            }
            if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
                liger.get("splBackBankNoId").setDisabled(true);
            }
            if(liger.get("salBackBankNoId")&&liger.get("salBackBankNoId")!="undefined"){
                liger.get("salBackBankNoId").setDisabled(true);
            }
            if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
                liger.get("isBckNo").setDisabled(true);
            }
            if(liger.get("isSalBckNo")&&liger.get("isSalBckNo")!="undefined"){
                liger.get("isSalBckNo").setDisabled(true);
            }
            if(liger.get("splMfrId")&&liger.get("splMfrId")!="undefined"){
                liger.get("splMfrId").setDisabled(true);
            }
            if(liger.get("guidePc")&&liger.get("brCdNm")!="undefined"){
                liger.get("guidePc").setDisabled(true);
            }
            if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
                liger.get("mfrNm").setDisabled(true);
            }

            if($("#prdRem")&&$("#prdRem")!="undefined"){
                $("#prdRem").setDisabled_ligerTextarea(true);
            }

            if($("#mOthInfo")&&$("#mOthInfo")!="undefined"){
                $("#mOthInfo").setDisabled_ligerTextarea(true);
            }

            if(liger.get("prdAmt")&&liger.get("prdAmt")!="undefined"){
                liger.get("prdAmt").setDisabled(true);
            }
            if(liger.get("isNew")&&liger.get("isNew")!="undefined"){
                liger.get("isNew").setDisabled(true);
            }

            if(liger.get("fuelTypCd")&&liger.get("fuelTypCd")!="undefined"){
                liger.get("fuelTypCd").setDisabled(true);
            }
            if(liger.get("rsrvPc")&&liger.get("rsrvPc")!="undefined"){
                liger.get("rsrvPc").setDisabled(true);
            }
            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                var qty = liger.get("prdQty");
                qty.setDisabled(true);
            }

            if(liger.get("irrPct")&&liger.get("irrPct")!="undefined"){
                liger.get("irrPct").setDisabled(true);
            }

            if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
                liger.get("deprRate").setDisabled(true);
            }

            if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
                liger.get("deprAmt").setDisabled(true);
            }
            if(liger.get("invAmt")&&liger.get("invAmt")!="undefined"){
                liger.get("invAmt").setDisabled(true);
            }

			if(isDetail==0 && (prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD)){

			}else {
				if(liger.get("certDt")&&liger.get("certDt")!="undefined"){
					liger.get("certDt").setDisabled(true);
				}
				if(liger.get("vehCheckCode")&&liger.get("vehCheckCode")!="undefined"){
					liger.get("vehCheckCode").setDisabled(true);
				}
			}

            if(liger.get("secUsedPd")&&liger.get("secUsedPd")!="undefined"){
                liger.get("secUsedPd").setDisabled(true);
            }
            if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
                liger.get("deprRate").setDisabled(true);
            }

            if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
                liger.get("deprAmt").setDisabled(true);
            }
            if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
                liger.get("mfrNm").setDisabled(true);
            }

            if($("#prdRem")&&$("#prdRem")!="undefined"){
                $("#prdRem").setDisabled_ligerTextarea(true);
            }
            if(liger.get("splId")&&liger.get("splId")!="undefined"){
                liger.get("splId").setDisabled(true);
            }
			if(liger.get("recommendSplId")&&liger.get("recommendSplId")!="undefined"){
				liger.get("recommendSplId").setDisabled(true);
			}
            if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
                liger.get("buyWayCd").setDisabled(true);
            }


            if(liger.get("brTypCd")&&liger.get("brTypCd")!="undefined"){
                liger.get("brTypCd").setDisabled(true);
            }

            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                liger.get("prdQty").setDisabled(true);
            }
            //新能源
            if(liger.get("seatRowCd")&&liger.get("seatRowCd")!="undefined"){
                liger.get("seatRowCd").setDisabled(true);
            }
            if(liger.get("carVol")&&liger.get("carVol")!="undefined"){
                liger.get("carVol").setDisabled(true);
            }
            if(liger.get("extMil")&&liger.get("extMil")!="undefined"){
                liger.get("extMil").setDisabled(true);
            }
            if(liger.get("batDeg")&&liger.get("batDeg")!="undefined"){
                liger.get("batDeg").setDisabled(true);
            }
			if(liger.get("batBrand")&&liger.get("batBrand")!="undefined"){
				liger.get("batBrand").setDisabled(true);
			}
            if(liger.get("custFina")&&liger.get("custFina")!="undefined"){
                liger.get("custFina").setDisabled(true);
            }
            if(liger.get("isAdvLic")&&liger.get("isAdvLic")!="undefined"){
                liger.get("isAdvLic").setDisabled(true);
            }
            if(liger.get("advLicTm")&&liger.get("advLicTm")!="undefined"){
                liger.get("advLicTm").setDisabled(true);
            }
        }
		//是否可编辑推荐经销商
		if(liger.get("recommendSplId")&&liger.get("recommendSplId")!="undefined"&&isCanEditRecommendSpl == '0'){
			liger.get("recommendSplId").setDisabled(true);
		}

        if(detailFlag=="true"){

            if(liger.get("mWhlSpec")&&liger.get("mWhlSpec")!="undefined"){
                liger.get("mWhlSpec").setDisabled(true);
            }
            if(liger.get("thickness")&&liger.get("thickness")!="undefined"){
                liger.get("thickness").setDisabled(true);
            }

            if(liger.get("grboxMdl")&&liger.get("grboxMdl")!="undefined"){
                liger.get("grboxMdl").setDisabled(true);
            }
            if(liger.get("actCntrSz")&&liger.get("actCntrSz")!="undefined"){
                liger.get("actCntrSz").setDisabled(true);
            }
            if($("#othInfo")&&$("#othInfo")!="undefined"){
                $("#othInfo").setDisabled_ligerTextarea(true);
            }
            if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
                liger.get("liftWayCd").setDisabled(true);
            }
            if(liger.get("doorInfo")&&liger.get("doorInfo")!="undefined"){
                liger.get("doorInfo").setDisabled(true);
            }
            if(liger.get("cylSepc")&&liger.get("cylSepc")!="undefined"){
                liger.get("cylSepc").setDisabled(true);
            }
            if(liger.get("tankVol")&&liger.get("tankVol")!="undefined"){
                liger.get("tankVol").setDisabled(true);
            }
            if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
                liger.get("trlWhlSpec").setDisabled(true);
            }
            if(liger.get("axleInfo")&&liger.get("axleInfo")!="undefined"){
                liger.get("axleInfo").setDisabled(true);
            }
            if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
                liger.get("matQalCd").setDisabled(true);
            }

            if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
                liger.get("matQalCd").setDisabled(true);
            }
            if(liger.get("isHvWhl")&&liger.get("isHvWhl")!="undefined"){
                liger.get("isHvWhl").setDisabled(true);
            }
            if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
                liger.get("trlWhlSpec").setDisabled(true);
            }
            if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
                liger.get("liftWayCd").setDisabled(true);
            }
            if(liger.get("isHvSub")&&liger.get("isHvSub")!="undefined"){
                liger.get("isHvSub").setDisabled(true);
            }

        }

        if(detailFlag=="true"){

            if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
                liger.get("prdClsCd").setDisabled(true);
            }
            if(liger.get("cabSpec")&&liger.get("cabSpec")!="undefined"){
                liger.get("cabSpec").setDisabled(true);
            }
            if(liger.get("rearAxleSpec")&&liger.get("rearAxleSpec")!="undefined"){
                liger.get("rearAxleSpec").setDisabled(true);
            }
            if(liger.get("cntrSz")){
                liger.get("cntrSz").setDisabled(true);
            }
            if(liger.get("emiStd")){
                liger.get("emiStd").setDisabled(true);
            }
            if(liger.get("carMdl")&&liger.get("carMdl")!="undefined"){
                liger.get("carMdl").setDisabled(true);
            }
            if(liger.get("outVol")&&liger.get("outVol")!="undefined"){
                liger.get("outVol").setDisabled(true);
            }
            if(liger.get("grboxCfg")&&liger.get("grboxCfg")!="undefined"){
                liger.get("grboxCfg").setDisabled(true);
            }
            if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
                liger.get("carEngMdl").setDisabled(true);
            }

            if(liger.get("carCl")&&liger.get("carCl")!="undefined"){
                liger.get("carCl").setDisabled(true);
            }
            if(liger.get("maxSpd")&&liger.get("maxSpd")!="undefined"){
                liger.get("maxSpd").setDisabled(true);
            }
            if($("#othCfg")&&$("#othCfg")!="undefined"){
                $("#othCfg").setDisabled_ligerTextarea(true);
            }
            if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
                liger.get("carLen").setDisabled(true);
            }
            if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
                liger.get("drvTypCd").setDisabled(true);
            }
            if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
                liger.get("carEngMdl").setDisabled(true);
            }
            if(liger.get("hp")&&liger.get("hp")!="undefined"){
                liger.get("hp").setDisabled(true);
            }
            if(liger.get("prdYr")&&liger.get("prdYr")!="undefined"){
                liger.get("prdYr").setDisabled(true);
            }
            if(liger.get("prdCyCd")&&liger.get("prdCyCd")!="undefined"){
                liger.get("prdCyCd").setDisabled(true);
            }
            if(liger.get("grboxTypCd")&&liger.get("grboxTypCd")!="undefined"){
                liger.get("grboxTypCd").setDisabled(true);
            }
            if(liger.get("seatQtyCd")&&liger.get("seatQtyCd")!="undefined"){
                liger.get("seatQtyCd").setDisabled(true);
            }
            if(liger.get("carStrcCd")&&liger.get("carStrcCd")!="undefined"){
                liger.get("carStrcCd").setDisabled(true);
            }
            if(liger.get("prdWayCd")&&liger.get("prdWayCd")!="undefined"){
                liger.get("prdWayCd").setDisabled(true);
            }
            if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
                liger.get("powerTypCd").setDisabled(true);
            }

            if(liger.get("carStrcCfg")&&liger.get("carStrcCfg")!="undefined"){
                liger.get("carStrcCfg").setDisabled(true);
            }
        }
        if((buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK)&&!((prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW && isSplMfr == '1')||(prjTypCd==ProjectConstant.PRJ_TYP_CD_CTYW && isSplMfr == '1'))
            &&!insCode){
            $("#guideMsgDiv").show();
        }
        if(hasSplBackNo==1){
            $("#splBckBankAccDiv").show();
        }
        if(hasSalBackNo==1){
            $("#salBckBankAccDiv").show();
            $("#msgDiv").show();
        }
        if(hasBackNoFlag==1){
            //供应商返利账号、销售账号只读
            if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
                liger.get("splBackBankNoId").setDisabled(true);
            }
            if(liger.get("salBackBankNoId")&&liger.get("salBackBankNoId")!="undefined"){
                liger.get("salBackBankNoId").setDisabled(true);
            }
            if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
                liger.get("isBckNo").setDisabled(true);
            }
            if(liger.get("isSalBckNo")&&liger.get("isSalBckNo")!="undefined"){
                liger.get("isSalBckNo").setDisabled(true);
            }
        }

        if(hasAccNoFlag==1){

			if(liger.get("receiveTypeCd")&&liger.get("receiveTypeCd")!="undefined"){
				liger.get("receiveTypeCd").setDisabled(true);
			}
			if(liger.get("splId")&&liger.get("splId")!="undefined"){
				liger.get("splId").setDisabled(true);
			}
			if(liger.get("cstSplId")&&liger.get("cstSplId")!="undefined"){
				liger.get("cstSplId").setDisabled(true);
			}
			if(liger.get("cstSplAccNoId")&&liger.get("cstSplAccNoId")!="undefined"){
				liger.get("cstSplAccNoId").setDisabled(true);
			}
            //放款账号只读
            if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
                liger.get("splAccNoId").setDisabled(true);
            }
        }

		$("#vehValDiv").hide();
		$("#custFinaDiv").hide();
		$("#vehVal").attr("validate","");
		$("#custFina").attr("validate","");

        if((buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK)&&((prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW && isSplMfr == '1')||(prjTypCd==ProjectConstant.PRJ_TYP_CD_CTYW && isSplMfr == '1'))){
            $("#splMfrDiv").show();
            $("#splMfrInfoValidate").attr("validate","{required:true}");
        }
        if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW || prjTypCd==ProjectConstant.PRJ_TYP_CD_LCV){
            $("#licenseCdDiv").show();
            $("#licenseCdTxt").show();
            $("#licenseCd").attr("validate","{required:true}");
        }else{
            $("#licenseCdDiv").hide();
            $("#licenseCdTxt").hide();
            $("#licenseCd").attr("validate","");
        }
        if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0002||plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011){
            $("#drvTypCd").attr("validate","{required:true}");
            var html = '<span class="requiredSymbol" id="drvTypCdReq">*</span>';
            $("#drvTypCd").parent().append(html);
        }else{
            $("#drvTypCd").attr("validate","");
            $("#drvTypCdReq").hide();
        }
        $("#drvTypCd").change(function () {
            var drvTyp = $(this).val();
            if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
                $("#hp").attr("validate","{required:true}");
                var hpReq = $("#hpReq").text();
                if(!hpReq){
                    var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
                    $("#hp").parent().append(hpHtml);
                }else{
                    $("#hpReq").show();
                }
            }else{
                $("#hp").attr("validate","");
                $("#hpReq").hide();
            }
        });

		//换车需求，新增产品信息时，项目相关信息取旧车的，不可修改
		$("#addBtnSpl").hide();
		if (liger.get("guidePc")) {
			liger.get("guidePc").setDisabled(true);
		}
		if (liger.get("prdQty")) {
			liger.get("prdQty").setDisabled(true);
		}
		if (liger.get("prdAmt")) {
			liger.get("prdAmt").setDisabled(true);
		}
		if (liger.get("rsrvPc")) {
			liger.get("rsrvPc").setDisabled(true);
		}
		if (liger.get("vehVal")) {
			liger.get("vehVal").setDisabled(true);
		}
		if (liger.get("custFina")) {
			liger.get("custFina").setDisabled(true);
		}
		if (liger.get("irrPct")) {
			liger.get("irrPct").setDisabled(true);
		}
		if (liger.get("receiveTypeCd")) {
			liger.get("receiveTypeCd").setDisabled(true);
		}
		if (liger.get("splId")) {
			liger.get("splId").setDisabled(true);
		}
		if (liger.get("recommendSplId")) {
			liger.get("recommendSplId").setDisabled(true);
		}
		if (liger.get("cstSplId")) {
			liger.get("cstSplId").setDisabled(true);
		}
		if (liger.get("yqCstSplId")) {
			liger.get("yqCstSplId").setDisabled(true);
		}
		if (liger.get("cstSplAccNoId")) {
			liger.get("cstSplAccNoId").setDisabled(true);
		}
		if (liger.get("yqSplAccNoId")) {
			liger.get("yqSplAccNoId").setDisabled(true);
		}
		if (liger.get("splMfrId")) {
			liger.get("splMfrId").setDisabled(true);
		}
		if (liger.get("isHaveBckNo")) {
			liger.get("isHaveBckNo").setDisabled(true);
		}
		if (liger.get("isBckNo")) {
			liger.get("isBckNo").setDisabled(true);
		}
		if (liger.get("splBackBankNoId")) {
			liger.get("splBackBankNoId").setDisabled(true);
		}
		if (liger.get("isSalBckNo")) {
			liger.get("isSalBckNo").setDisabled(true);
		}
		if (liger.get("salBackBankNoId")) {
			liger.get("salBackBankNoId").setDisabled(true);
		}
		//放款账号只读
		if (liger.get("splAccNoId") && liger.get("splAccNoId") != "undefined") {
			liger.get("splAccNoId").setDisabled(true);
		}

        //满足条件支持修改车辆参考价,车辆估值保持不变
        if(guidePcEditFlag == 1){
            //车辆参考价可以修改
            if(liger.get("guidePc")){
                liger.get("guidePc").setEnabled();
            }
            //车辆参数量可以修改
            if(liger.get("prdQty")){
                liger.get("prdQty").setEnabled();
            }
            var tempGuidePc = $("#guidePc").val();
            var tempVehVal = $("#vehVal").val();
            console.log("车辆参考价是否可编辑标志 tempGuidePc>>>>>>>>" + tempGuidePc) ;
            console.log("车辆参考价是否可编辑标志 tempVehVal>>>>>>>>" + tempVehVal) ;
            //新增产品时,设置参考价默认值为车辆估值
			if(!(tempGuidePc > 0)){
                $("#guidePc").val(tempVehVal);
                if(!($("#prdQty").val() > 0)){
                    $("#prdQty").val("1");
				}
				var tempPrdAmt = $("#prdQty").val() * $("#guidePc").val();
                console.log("车辆参考价是否可编辑标志 tempPrdAmt>>>>>>>>" + tempPrdAmt) ;
                $("#prdAmt").val(tempPrdAmt);
			}
        }

        //信审节点不允许修改车辆估值,收款方类型
        if(!(typeof isDetail == "undefined" || isDetail == null || isDetail == "") && isDetail==0){
            console.log("信审节点标志 isDetail>>>>>>>>" + isDetail) ;
            if(liger.get("receiveTypeCd")){
                liger.get("receiveTypeCd").setDisabled(true);
            }
        }

    });

	function checkAmt() {
		var purchaseFee = $("#rsrvPc").val();
		console.log("每台设备留购价的金额:" + purchaseFee);
		var checkRsrvPc;
		var _url = '<%=path%>/project/prjprdbscinfo/checkRsrvPc.do';
		var params = {};
		if (!checkRsrvPc) {
			$.ajax({
				type: 'get',
				dataType: 'json',
				data: params,
				url: _url,
				success: function (msg) {
					if (msg.success == 1) {
						checkRsrvPc = msg.data;
						if (checkRsrvPc) {
							checkRsrvPc = checkRsrvPc / 100;
							var rsrvPc = $("#rsrvPc").val();
							if (rsrvPc < checkRsrvPc) {
								top.$.ligerDialog.SQalert({content: "留购价不能小于100", SQ_type: "error"});
							}
						}
					} else {
						top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
					}
				}
			});
		}
	}

	//设置折旧后金额
	function setSecAmt() {
		var invAmt = $("#invAmt").val();
		var secRate = $("#deprRate").val();
		var discountAmt = 0;
		if (invAmt && secRate) {
			discountAmt = parseFloat(invAmt) * parseFloat(secRate);
		}
		$("#deprAmt").val(discountAmt);
	}

    function initData(){
		//默认数量为1
		var prdQty = $("#prdQty").val();
		if (prdQty == "") {
			$("#prdQty").val("1");
		}
		var rsrvPc = $("#rsrvPc").val();
		if (rsrvPc == "") {
			$("#rsrvPc").val("100");
		}

		if (!liger.get("certDt")) {
			//没有二手车信息，默认是新车，是否新车不可修改
			liger.get("isNew").setDisabled(true);
		}
		if (!id) {
			var isNew = $("#isNew").val();
			if (prjTypCd == ProjectConstant.CODE_PRJ_TYP_CD_ESC || prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD) {
				liger.get("isNew").setValue("0");
				//$("#isNew").val("0");
				//设置不可选
				var slt = liger.get("isNew");
				slt.setDisabled(true);
				setUsedPdShow();
				$("#isNew").hide();
			} else {
				if (isNew == '1') {
					//默认不可选
					var slt = liger.get("secUsedPd");
					slt.setDisabled(true);
				}
			}
		}



        var styleId = '${styleId}';
        var carSourceId = '${carSourceId}';
        var prdBscInfo = '${prdBscInfoVO}';
        var tkFlag ='${tkFlag}';
        var modifyFlag ='${modifyFlag}';
		if (modifyFlag) {
			getDataByDetailId(id);
		} else {
			setDataByPrdTypeAndDetailId(styleId);
		}
        if(tkFlag){
            $("#lnkComp").show();
            $("#tkOption").show();
        }
        setUsePdOption();//设置已用月份option
        var guidePc = $("#guidePc").val();
        var prdQty = $("#prdQty").val();
        if(guidePc&&prdQty){
            //设置小计值
            guidePcChange();
        }
    }
    //设置小计值
    function guidePcChange(){
		if(prjTypCd == 'CDDYWYQ'){
			liger.get("guidePc").setDisabled(true);
		}
        var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
        var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
        var total =0;
        if(guidePc&&prdQty){
            total = NumberUtils.mul(guidePc,prdQty);
        }
        $("#total").text(total);
        $("#prdAmt").val(total);
    }
    //设置可选
    function setUsedPdShow(){

        var prdmarks = $("#prdmarks").val();
        var isNew = $("#isNew").val();
        if(isNew=='0'){
            $("#SecondPrd").show();
            if(prdmarks!="car"){
                $("#SecondPrdText").show();
            }
            setUsePdOption();
            var usedPd=liger.get("secUsedPd");
            if(usedPd){
                if(detailFlag!="true"){
                    usedPd.setEnabled(true);
                }else{
                    usedPd.setDisabled(true);
                }
            }
            if(prdmarks!="car"){
                setSecAmt();
            }
            $("#isNew").hide();
        }
        if(isNew=='1'){
            $("#SecondPrd").hide();
            $("#SecondPrdText").hide();
            var usedPd=liger.get("secUsedPd");
            setUsePdOption();
            if(usedPd){
                liger.get("secUsedPd").setValue(0);
                usedPd.setDisabled(true);
            }
        }
    }
    function setAdvLicTmShow(){
    	var isAdvLic = $("#isAdvLic").val();
    	if ("1" == isAdvLic){
    		$("#advLicTmDiv").show();
		}else {
    		$("#advLicTmDiv").hide();
		}
	}
    //设置可选
    function setUsedPd(){
        var certDt = liger.get("certDt").getValue();
        if(certDt){
            var date = new Date(certDt);
            var month=date.getMonth()+1;
            var currMonth = (new Date()).getMonth()+1;
            var year = date.getYear();
            var currYear = (new Date()).getYear();
            var diffMonth =(currYear-year)*12+ currMonth-month+1;
            liger.get("secUsedPd").setValue(diffMonth);

			//设置usedPd值，并设为不可选
			var usedPd=liger.get("usedPd");
			if(usedPd){
				liger.get("usedPd").setValue(diffMonth);
				usedPd.setDisabled(true);
			}
			//设置折旧率
			var _url ='<%=path%>/project/prjbscinfo/getDiscountRate.do';
			var params = {};
			params.month=diffMonth;
			$.ajax({
				type: 'get',
				dataType:'json',
				data:params,
				url: _url,
				success:function(msg){
					if(msg.success == 1){
						$("#deprRate").val(msg.data);
					}else{
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
					}
				}
			});

        }
    }
    var fromCddFlag = '${fromCddFlag}';
    function getDataByDetailId(prjPrdId){
        var _url ='<%=path%>/project/vehicle/getPrjPrdBscInfoAndExtById.do';
        if(!prjPrdId)return;

        $.ajax({
            type: 'get',
            dataType:'json',
            data:{id:prjPrdId},
            url: _url,
            success:function(msg){
                if(msg){
                    setPrjPrdBscInfo(msg);//设置数据
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }
    function setPrjPrdBscInfo(basePrdInfo){
        console.log("setPrjPrdBscInfo 厂商指导价-->"+basePrdInfo.mfrGuidePc);
        var prjPrdExtVO = basePrdInfo.prjPrdExtVO;
        var prjPrdSourceVO = basePrdInfo.prjPrdSourceInfo;
        setMfrComboBoxText(basePrdInfo.mfrNm)
        if(basePrdInfo){
            var basePrdForm1 = liger.get("basePrdForm1");
            basePrdForm1.setData({
                prdNm: basePrdInfo.prdNm,
                carStyleName: basePrdInfo.carStyleName,
                modelNm: basePrdInfo.modelNm,
                prdClsCdNm: basePrdInfo.prdClsCdNm,
                prdTypCd: basePrdInfo.prdTypCd,
                prdCd: basePrdInfo.prdCd,
                brCdNm:basePrdInfo.brCd,
                brCd: basePrdInfo.brCd,
                prdMdl: basePrdInfo.prdMdl,
                prdMdlSun: basePrdInfo.prdMdlSun,
                mfrId: basePrdInfo.mfrId,
                mfrNm: basePrdInfo.mfrNm,
                prdRem: basePrdInfo.prdRem,
                audStsCd: basePrdInfo.audStsCd,
                prdTypCdNm: basePrdInfo.prdTypCdNm,
                isNew :basePrdInfo.isNew ,
                usedPd :basePrdInfo.usedPd ,
                secUsedPd :basePrdInfo.usedPd ,
                rsrvPc :basePrdInfo.rsrvPc ,
                guidePc :basePrdInfo.guidePc,
                mfrGuidePc: basePrdInfo.mfrGuidePc,
                prdQty :basePrdInfo.prdQty ,
                prdAmt :basePrdInfo.prdAmt ,
                prdUseCd :basePrdInfo.prdUseCd ,
                prdRem :basePrdInfo.prdRem ,
                irrPct :basePrdInfo.irrPct ,
                prdbscInfoId:basePrdInfo.id,
                usedPd:basePrdInfo.usedPd,
                prdAmt:basePrdInfo.prdAmt,
                certDt:basePrdInfo.certDt,
                invAmt:basePrdInfo.invAmt,
                splId:basePrdInfo.splId,
                prdId:basePrdInfo.prdId,
                guidePc:basePrdInfo.guidePc,
                splAccNoId:basePrdInfo.splAccNoId,
                vehVal:basePrdInfo.vehVal,
                custFina:basePrdInfo.custFina,
                carSourceId:basePrdInfo.carSourceId,
                carNo:basePrdInfo.carNo,
                releaseDate:basePrdInfo.releaseDate,
				//
				certDt:basePrdInfo.certDt,
				invAmt:basePrdInfo.invAmt,
				deprRate:basePrdInfo.deprRate,
				deprAmt:basePrdInfo.deprAmt,
				prdDtlId:basePrdInfo.prdDtlId,
				vehCheckCode:basePrdInfo.vehCheckCode,
                loanableAmt:basePrdInfo.loanableAmt,
				isAdvLic:basePrdInfo.isAdvLic,
				advLicTm:basePrdInfo.advLicTm
			});
			if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
				if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
					liger.get("prdQty").setDisabled(true);
				}
			}
			$("#mfrId").val(basePrdInfo.mfrId);
			$("#brCd").val(basePrdInfo.brCd);
			$("#carId").val(basePrdInfo.id);
			$("#tkId").val(basePrdInfo.id);
			$("#isNew").val(basePrdInfo.isNew);
			$("#prdId").val(basePrdInfo.prdId);
			$("#prdDtlId").val(basePrdInfo.prdDtlId);
			$("#prdbscInfoId").val(basePrdInfo.id);
			$("#vehCheckCode").val(basePrdInfo.vehCheckCode);
			if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCd == 'CPYW') {
                $("#isAdvLic").val(basePrdInfo.isAdvLic);
				if (basePrdInfo.isAdvLic==1){
					var advLicTmStr = renderDate(basePrdInfo.advLicTm);
					$("#advLicTm").val(advLicTmStr);
				}
            }
			searchSplNm = basePrdInfo.splNm;
			var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
			var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
			var total = NumberUtils.mul(guidePc,prdQty);
			$("#total").text(total);
			beforePrdQty = prdQty;
			beforeGuidePc = guidePc;
			beforeRsrvPc = $("#rsrvPc").val();
            beforeVehVal = $("#vehVal").val();
            beforeCustFina = $("#custFina").val();
            basePrdForm1 = liger.get("basePrdForm1");
            $("#isTk").hide();
            $("#prdmarks").val("car");
            liger.get("isNew").setEnabled(true);


            basePrdForm1.setData({
                modelNm:prjPrdExtVO.modelName,
                productionCompany:prjPrdExtVO.productionCompany,
                carLen: prjPrdExtVO.carLen,
                prdYr: prjPrdExtVO.prdYr,
                prdCyCd: prjPrdExtVO.prdCyCd,
                outVol: prjPrdExtVO.outVol,
                prdMdlSun: prjPrdExtVO.prdMdl,
                grboxTypCd: prjPrdExtVO.grboxTypfd,
                grboxCfg: prjPrdExtVO.grboxCfg,
                seatQtyCd: prjPrdExtVO.seatQtyCd,
                engMdl: prjPrdExtVO.engMdl,
                drvTypCd: prjPrdExtVO.drvTypCd,
                carStrcCd: prjPrdExtVO.carStrcCd,
                carStrcCfg: prjPrdExtVO.carStrcCfg,
                powerTypCd: prjPrdExtVO.powerTypCd,
                carCl: prjPrdExtVO.carCl,
                maxSpd: prjPrdExtVO.maxSpd,
                prdWayCd: prjPrdExtVO.prdWayCd,
                carMdl: prjPrdExtVO.carMdl,
                othCfg: prjPrdExtVO.othCfg,
                carVol: prjPrdExtVO.carVol,
                extMil: prjPrdExtVO.extMil,
                batDeg: prjPrdExtVO.batDeg,
				batBrand: prjPrdExtVO.batBrand,
                emiStdCd:prjPrdExtVO.emiStdCd,
                carId:prjPrdExtVO.id,
                prdLvlCd:prjPrdExtVO.prdLvlCd
            });
            $("#carId").val(prjPrdExtVO.id);
            basePrdForm1 = liger.get("basePrdForm1");
            basePrdForm1.setData({
                prdId: prjPrdExtVO.prdId,
                drvTyp: prjPrdExtVO.drvTyp,
                engMdl: prjPrdExtVO.engMdl,
                hp: prjPrdExtVO.hp,
                emiStd: prjPrdExtVO.emiStd,
                cabSpec: prjPrdExtVO.cabSpec,
                prdMdlSun: prjPrdExtVO.prdMdl,
                grboxMdl: prjPrdExtVO.grboxMdl,
                rearAxleSpec: prjPrdExtVO.rearAxleSpec,
                mWhlSpec: prjPrdExtVO.mwhlSpec,
                prdClsCd: prjPrdExtVO.prdClsCd,
                prdCd: prjPrdExtVO.prdCd,
                cntrSz: prjPrdExtVO.cntrSz,
                actCntrSz: prjPrdExtVO.actCntrSz,
                thickness: prjPrdExtVO.thickness,
                axleInfo: prjPrdExtVO.axleInfo,
                matQalCd: prjPrdExtVO.matQalCd,
                liftWayCd: prjPrdExtVO.liftWayCd,
                doorInfo: prjPrdExtVO.doorInfo,
                isHvWhl: prjPrdExtVO.isHvWhl,
                trlWhlSpec: prjPrdExtVO.trlWhlSpec,
                cylSepc: prjPrdExtVO.cylSepc,
                tankVol: prjPrdExtVO.tankVol,
                othInfo: prjPrdExtVO.othInfo,
                tkId:prjPrdExtVO.id,
                brTypCd:prjPrdExtVO.brTypCd,
                buyWayCd:prjPrdExtVO.buyWayCd,
                prdClsCd:prjPrdExtVO.prdClsCd,
                emiStd:prjPrdExtVO.emiStd,
                gasCylSpec:prjPrdExtVO.gasCylSpec,
                saddleSpec:prjPrdExtVO.saddleSpec,
                isHvAirCnd:prjPrdExtVO.isHvAirCnd,
                whlBase:prjPrdExtVO.whlBase,
                isHvSub:prjPrdExtVO.isHvSub,
                batDeg:prjPrdExtVO.batDeg,
				batBrand:prjPrdExtVO.batBrand,
                seatRowCd:prjPrdExtVO.seatRowCd,
                clsExfPc:prjPrdExtVO.clsExfPc,
                mOthInfo:prjPrdExtVO.mothInfo,
                gerrBoxBrand:prjPrdExtVO.gerrBoxBrand,
                styleEngine:prjPrdExtVO.styleEngine,
                fuelTypCd:prjPrdExtVO.fuelTypCd,
				tvlMil:prjPrdExtVO.tvlMil
            });


            basePrdForm1 = liger.get("basePrdForm1");
            basePrdForm1.setData({
                parkingLot: prjPrdSourceVO.parkingLot,
                classNm: prjPrdSourceVO.classNm,
                vehCheckCodeNm: basePrdInfo.vehCheckCodeNm,
                vehCheckCode: basePrdInfo.vehCheckCode,
                surveyorNm: prjPrdSourceVO.surveyorNm,
                vehValNew: prjPrdSourceVO.vehValNew,
                vehVal: basePrdInfo.vehVal,
                timeDiff: prjPrdSourceVO.timeDiff,
                licDt:prjPrdSourceVO.licDt,
                licNo:prjPrdSourceVO.licNo
            });
            setUsedPdShow();
            setSecAmt();
            var vehVel = $("#vehVel").val();
            var vehValNew = $("#vehValNew").val();

            if(vehVel){
                var val1 = parseFloat(basePrdInfo.vehVal).toFixed(2);
                $("#vehVel").val(val1);
            }
            if(vehValNew){
                var val = parseFloat(prjPrdSourceVO.vehValNew).toFixed(2);
                $("#vehValNew").val(val);
            }
            if(vehVel&&vehValNew){
               var val =  (parseFloat((vehVel-vehValNew)/vehVel)).toFixed(2);
                $("#floatPct").val(val);
            }

            var releaseDateStr = renderDate(basePrdInfo.releaseDate);
            $("#releaseDate").val(releaseDateStr);
        }
    }
    //格式化时间
    function renderDate(value){
        var dateStr = "";
        if(null != value){
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
    function setDataByPrdTypeAndDetailId(styleId){
        var _url ='<%=path%>/project/vehicle/carDetail.do';
        $.ajax({
            type: 'get',
            dataType:'json',
            data:{id:styleId},
            url: _url,
            async:false,
            success:function(msg){
                if(msg){
                    setData(msg);//设置数据
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }

    function setUsePdOption(){
        var html = "";
        for(var i=1;i<31;i++){
            html+="<option value="+i+">"+i+"个月</option>";
        }
        $("#secUsedPd").append(html);
    }

    function setMfrComboBoxText(mfrNm){
        if(mfrNm){
            var mfrComboBox = liger.get("mfr");
            if(mfrComboBox){
                mfrComboBox.setText(mfrNm);
            }
        }
    }



    function setData(basePrdInfo){
        console.log("setData 厂商指导价-->"+basePrdInfo.mfrGuidePc);
        var basePrdForm1 = liger.get("basePrdForm1");
        if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                liger.get("prdQty").setDisabled(true);
            }
            basePrdForm1.setData({
                prdQty: basePrdInfo.ctrValue
            });
        }else{
			if(!(liger.get("prdQty")&&liger.get("prdQty")!="undefined")){
				basePrdForm1.setData({
					prdQty: 1
				});
			}
        }
        basePrdForm1.setData({
            modelNm:basePrdInfo.modelName,
            carStyleName:basePrdInfo.carStyleName,
            styleId:basePrdInfo.styleId,
            productionCompany:basePrdInfo.productionCompany,
            prdNm: basePrdInfo.prdNm,
            prdClsCdNm: basePrdInfo.prdClsCdNm,
            prdClsCd: basePrdInfo.prdClsCd,
            prdCd: basePrdInfo.prdCd,
            prdTypCd: basePrdInfo.prdTypCd,
            brCdNm:basePrdInfo.brCdNm,
            brCd: basePrdInfo.brCd,
            prdMdl: basePrdInfo.prdMdl,
            prdMdlSun:basePrdInfo.prdMdl,
            secUsedPd :basePrdInfo.usedPd ,
            mfrId: basePrdInfo.mfrId,
            mfrNm: basePrdInfo.mfrNm,
            mfrGuidePc: basePrdInfo.mfrGuidePc,
            guidePc :basePrdInfo.guidePcDouble,
            prdRem: basePrdInfo.prdRem,
            audStsCd: basePrdInfo.audStsCd,
            prdTypCdNm: basePrdInfo.prdTypCdNm,
            prdId:basePrdInfo.id,
            gerrBoxBrand:basePrdInfo.gerrBoxBrand,
            styleEngine:basePrdInfo.styleEngine,
            releaseDate:basePrdInfo.releaseDateStr,
            carSourceId:basePrdInfo.carSourceId,
            carNo:basePrdInfo.carNo,
            vehCheckCode:basePrdInfo.vehCheckCode,
            vehCheckCodeNm:basePrdInfo.vehCheckCodeNm,
            vehVal:basePrdInfo.vehVal,
            modelNm:basePrdInfo.modelNm
        });

        basePrdForm1 = liger.get("basePrdForm1");
        // car
        $("#isTk").hide();
        liger.get("isNew").setEnabled(true);

        var guidePc = (basePrdInfo.guidePc/100).toFixed(2);


        basePrdForm1.setData({
            /* prdSeries: carInfo.prdSeries, */
            carLen: basePrdInfo.carLen,
            prdYr: basePrdInfo.prdYr,
            prdCyCd: basePrdInfo.prdCyCd,
            outVol: basePrdInfo.outVol,
            grboxTypCd: basePrdInfo.grboxTypCd,
            grboxCfg: basePrdInfo.grboxCfg,
            seatQtyCd: basePrdInfo.seatQtyCd,
            engMdl: basePrdInfo.engMdl,
            drvTypCd: basePrdInfo.drvTypCd,
            carStrcCd: basePrdInfo.carStrcCd,
            carStrcCfg: basePrdInfo.carStrcCfg,
            powerTypCd: basePrdInfo.powerTypCd,
            guidePc :basePrdInfo.guidePc,
            mfrGuidePc: basePrdInfo.basePrdInfo,
            maxSpd: basePrdInfo.maxSpd,
            prdWayCd: basePrdInfo.prdWayCd,
            carMdl: basePrdInfo.carMdl,
            othCfg: basePrdInfo.othCfg,
            carVol: basePrdInfo.carVol,
            extMil: basePrdInfo.extMil,
            batDeg: basePrdInfo.batDeg,
			batBrand: basePrdInfo.batBrand,
            emiStdCd:basePrdInfo.emiStdCd,
            prdId:basePrdInfo.prdId,
            prdLvlCd:basePrdInfo.prdLvlCd
        });


        basePrdForm1 = liger.get("basePrdForm1");
        // TK
        basePrdForm1.setData({
            prdId: basePrdInfo.prdId,
            drvTyp: basePrdInfo.drvTyp,
            engMdl: basePrdInfo.engMdl,
            hp: basePrdInfo.hp,
            emiStd: basePrdInfo.emiStd,
            cabSpec: basePrdInfo.cabSpec,
            grboxMdl: basePrdInfo.grboxMdl,
            rearAxleSpec: basePrdInfo.rearAxleSpec,
            mWhlSpec: basePrdInfo.mWhlSpec,
            guidePc :basePrdInfo.guidePc,
            cntrSz: basePrdInfo.cntrSz,
            actCntrSz: basePrdInfo.actCntrSz,
            thickness: basePrdInfo.thickness,
            axleInfo: basePrdInfo.axleInfo,
            prdMdl: basePrdInfo.prdMdl,
            matQalCd: basePrdInfo.matQalCd,
            liftWayCd: basePrdInfo.liftWayCd,
            doorInfo: basePrdInfo.doorInfo,
            isHvWhl: basePrdInfo.isHvWhl,
            trlWhlSpec: basePrdInfo.trlWhlSpec,
            cylSepc: basePrdInfo.cylSepc,
            tankVol: basePrdInfo.tankVol,
            othInfo: basePrdInfo.othInfo,
            prdId:basePrdInfo.prdId,

			gasCylSpec:basePrdInfo.gasCylSpec,
			saddleSpec:basePrdInfo.saddleSpec,
			isHvAirCnd:basePrdInfo.isHvAirCnd,
			whlBase:basePrdInfo.whlBase,
			isHvSub:basePrdInfo.isHvSub,
			batDeg:basePrdInfo.batDeg,
			batBrand: basePrdInfo.batBrand,
			seatRowCd:basePrdInfo.seatRowCd,
			clsExfPc:basePrdInfo.clsExfPc,
			mOthInfo:basePrdInfo.mOthInfo,
			fuelTypCd:basePrdInfo.fuelTypCd,
			tvlMil:basePrdInfo.mil
		});
        basePrdForm1 = liger.get("basePrdForm1");
        basePrdForm1.setData({
            parkingLot: basePrdInfo.parkingLot,
            classNm: basePrdInfo.classNm,
            vehCheckCodeNm: basePrdInfo.vehCheckCodeNm,
            vehCheckCode: basePrdInfo.vehCheckCode,
            surveyorNm: basePrdInfo.surveyorNm,
            vehValNew: basePrdInfo.vehValNew,
            gerrBoxBrand:basePrdInfo.gerrBoxBrand,
            styleEngine:basePrdInfo.styleEngine,
            licDt:basePrdInfo.licDtStr,
            vin:basePrdInfo.vin,
            licNo:basePrdInfo.licNo,
            styleEngine:basePrdInfo.styleEngine,
            gerrBoxBrand:basePrdInfo.gerrBoxBrand

        });
		if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
			liger.get("drvTypCd").setValue(basePrdInfo.drvTyp);
		}
		var drvTyp = basePrdInfo.drvTyp;
		if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
			$("#hp").attr("validate","{required:true}");
			var hpReq = $("#hpReq").text();
			if(!hpReq){
				var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
				$("#hp").parent().append(hpHtml);
			}else{
				$("#hpReq").show();
			}
		}else{
			$("#hp").attr("validate","");
			$("#hpReq").hide();
		}
		if(basePrdInfo.vehVal){
            var vehVal = (parseFloat(basePrdInfo.vehVal)).toFixed(2);
            $("#vehVal").val(vehVal);
            $("#vehValNew").val(vehVal);
        }

        $("#prdDtlId").val(prdDetailId);
        $("#mfrId").val(basePrdInfo.mfrId);
        $("#brCd").val(basePrdInfo.brCd);
        $("#prdId").val(basePrdInfo.id);
        $("#vehCheckCode").val(basePrdInfo.vehCheckCode);
        var guidePc = $("#guidePc").val();
        var prdQty = $("#prdQty").val();
        if(guidePc&&prdQty){
            //设置小计值
            guidePcChange();
        }

        setUsedPdShow()
    }

    //取消
    function cancelBtn(){
        var TAB=top.mainApp.parentTab;
        var currentTabid=TAB.getSelectedTabItemID();
        top.tab.removeTabItem(currentTabid);
    }

    function savePrjBscInfo(){
		var purchaseFee = $("#rsrvPc").val();
		console.log("保存按钮，每台设备留购价的金额:" + purchaseFee);
		//供应商返利账号
		var isBckNo = $("#isBckNo").val();
		var splBackBankNo = $("#splBackBankNoId").val();
		//销售返利账号
		var isSalBckNo = $("#isSalBckNo").val();
		var salBackBankNo = $("#salBackBankNoId").val();

		//厂商
		var splMfrId = $("#splMfrId").val();
		if (prjTypCd != 'CDDYWYQ') {
			var ligerForm = liger.get("basePrdForm1");
			if (!ligerForm.valid()) {
				top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
				return false; //验证不通过，不执行以下代码
			}
			var isNew = $("#isNew").val();
			var certDt = $("#certDt").val();
			if ('0' == isNew && ('' == certDt || null == certDt)) {
				top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
				return false; //验证不通过，不执行以下代码
			}
		}
		var vehCheckCode = $("#vehCheckCode").val();
		if ('0' == isNew && ('' == vehCheckCode || null == vehCheckCode || '0' == vehCheckCode)) {
			top.$.ligerDialog.SQalert({content: "请核实车源库验车方式！", SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
		}
		if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCd == 'CPYW') {
			var isAdvLic = $("#isAdvLic").val();
			var advLicTm = $("#advLicTm").val();
			if (' ' == isAdvLic || null == isAdvLic) {
				top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
				return false;
			}
			if ('1' == isAdvLic && ('' == advLicTm || null == advLicTm)) {
				top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
				return false;
			}
		}


		var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
		var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
		var prdbscInfoId = $("#prdbscInfoId").val();
		var rsrvPc = $("#rsrvPc").val();
		var vehVal = $("#vehVal").val();
		var custFina = $("#custFina").val();

		if (guidePc && prdQty && prdbscInfoId && rsrvPc) {
			if (guidePc != beforeGuidePc || beforePrdQty != prdQty || rsrvPc != beforeRsrvPc) {
				var _ids = [];
				_ids.push(prdbscInfoId);
				var params = {};
				params.prjId = prjId;
				params.ids = JSON.stringify(_ids);
				// 查询支付表是否存在
				$.ajax({
					type: 'get',
					dataType: 'json',
					data: params,
					url: '<%=path%>/project/prjprdbscinfo/checkPrjPrdDtlExist.do',
					success: function (msg) {
						if (msg.data == true) {
							$.ligerDialog.SQalert({
								SQ_showButtons: true,
								SQ_onBtnclick: function (item, Dialog) {
									$("#removeFlag").val(CommonConstant.C_YN_Y);
									save();
								},
								content: "已经存在支付表信息，确定删除已经拆分的支付表,修改数量和指导价信息吗？"
							});
						} else {
							$("#removeFlag").val(CommonConstant.C_YN_N);
							save();
						}
					}
				});
			} else {
				$("#removeFlag").val(CommonConstant.C_YN_N);
				save();
			}
		} else {
			$("#removeFlag").val(CommonConstant.C_YN_N);
			save();
		}
	}

	//保存项目基础信息
	function save() {
		var ligerForm = liger.get("basePrdForm1");
		if (!ligerForm.valid()) {
			top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
		}
		var data = ligerForm.getData();
		var prjId = '${prjId}';
		var prdCd = '${pCd}';
		var isNew = $("#isNew").val();
		var rcCstBscInfoId = _rcCstBscInfoId;
		var receiveTypeCd = $("#receiveTypeCd").val();

		if (isNew == "1" && $("#prdbscInfoId").val()) {
			//设置二手车相应的字段为空
			data["invAmt"] = 0;
			data["certDt"] = null;
			data["usedPd"] = 0;
			data["deprRate"] = 0;
			data["deprAmt"] = 0;
			data["vehCheckCode"] = null;
		}
		data["guidePcEditFlag"] = guidePcEditFlag;
		data["prjId"] = prjId;
		data["prdCd"] = prdCd;
		data["splId"] = $("#splId").val();
		data["splNm"] = $("#splNm").val();
		data["recommendSplId"] = $("#recommendSplId").val();
		data["recommendSplNm"] = $("#recommendSplNm").val();
		data["styleId"] = "${styleId}";
		data["carSourceId"] = "${carSourceId}";
		data["carId"] = $("#carId").val();
		data["tkId"] = $("#tkId").val();
		data["mfrId"] = $("#mfrId").val();
		data["prdId"] = $("#prdId").val();
		data["prdDtlId"] = $("#prdDtlId").val();
		data["prdQty"] = $("#prdQty").val();
		data["vehCheckCode"] = $("#vehCheckCode").val();
		data["prdbscInfoId"] = $("#prdbscInfoId").val();
		data["removeFlag"] = $("#removeFlag").val();
		data["rcCstBscInfoId"] = rcCstBscInfoId;
		data["mfrGuidePc"] = "";//厂商指导价不入库
		data["splMfrId"] = $("#splMfrId").val();
		data["splMfrNm"] = $("#splMfrNm").val();
		data["prdTypCd"] = prdTypCd;
		if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCd == 'CPYW') {
			data["isAdvLic"] = $("#isAdvLic").val();
			if (data["isAdvLic"] == "1") {
				data["advLicTm"] = $("#advLicTm").val();
			}
		}
		// 如果选择了客车  验证是否有车身长度，如果没有则不允许保存
		if (prdTypCd) {
			if (prdTypCd == "52") {
				var carLen = $("#carLen").val();
				if (!carLen) {
					UIUtils.alertError("缺少车身长度信息，不能保存!");
					return false;
				}
			}
		}

		data["splAccNoId"] = $("#splAccNoId").val();
		data["cstSplAccNoId"] = $("#cstSplAccNoId").val();
		data["splBackBankNoId"] = $("#splBackBankNoId").val();
		data["salBackBankNoId"] = $("#salBackBankNoId").val();


		var accNoArr = [];
		var accNo1 = {};
		// if (prjTypCd != 'CDDYWYQ') {
		if (receiveTypeCd != ProjectConstant.RECEIVE_TYPE_CD_SPL) {
			accNo1.splAccNoId = $("#cstSplAccNoId").val();
			accNo1.purpCd = 1;
			accNoArr.push(accNo1);
		} else {
			//放款账号
			accNo1.splAccNoId = $("#splAccNoId").val();
			accNo1.purpCd = 1;
			accNoArr.push(accNo1);
			//返利账号
			var backNo = $("#splBackBankNoId").val();
			if (backNo) {
				var accNo2 = {};
				accNo2.splAccNoId = backNo;
				accNo2.purpCd = 2;
				accNoArr.push(accNo2);
			}
		}
		// }
		//销售返利账号
		var salBackAccNo = $("#salBackBankNoId").val();
		if (salBackAccNo) {
			var accNo3 = {};
			accNo3.splAccNoId = salBackAccNo;
			accNo3.purpCd = 11;
			accNoArr.push(accNo3);
		}

		//经销商代偿担保账号
		if (compensatoryType == '1' && guaranteePaymentType == '1') {
			var compensatorySplAccNoId = $("#compensatorySplAccNoId").val();
			var accNo4 = {};
			accNo4.splAccNoId = compensatorySplAccNoId;
			accNo4.purpCd = 14;
			accNoArr.push(accNo4);
		}
		//挂靠公司代偿担保账号
		if (compensatoryType == '1' && guaranteePaymentType == '2') {
			var compensatorySplAccNoId = $("#compensatorySplAccNoId").val();
			var accNo4 = {};
			accNo4.splAccNoId = compensatorySplAccNoId;
			accNo4.purpCd = 4;
			accNoArr.push(accNo4);
		}
		//经销商保证金担保账号
		if (compensatoryType == '2' && guaranteePaymentType == '1') {
			var depositSplAccNoId = $("#depositSplAccNoId").val();
			var accNo4 = {};
			accNo4.splAccNoId = depositSplAccNoId;
			accNo4.purpCd = 15;
			accNoArr.push(accNo4);
		}
		//挂靠公司保证金担保账号
		if (compensatoryType == '2' && guaranteePaymentType == '2') {
			var depositSplAccNoId = $("#depositSplAccNoId").val();
			var accNo4 = {};
			accNo4.splAccNoId = depositSplAccNoId;
			accNo4.purpCd = 3;
			accNoArr.push(accNo4);
		}

		/*if (prjTypCd == 'CDDYWYQ') {
			receiveTypeCd = "2";//疫情项目默认是承租人
			cstSplNm = $("#yqCstSplId").val();
			accNoArr = [];
			accNo1.splAccNoId = $("#yqSplAccNoId").val();
			accNo1.purpCd = 1;
			accNoArr.push(accNo1);
		}*/
		data["cstSplId"] = $("#cstSplId").val();
		data["cstSplNm"] = $("#cstSplNm").val();
		data["receiveTypeCd"] = receiveTypeCd;
		data["bankAccNoList"] = JSON.stringify(accNoArr);
		data["licenseCd"] = $("#licenseCd").val();
		data["insRoutePrdId"] = insRoutePrdId;
		//换车-新增项目产品时，调用新的接口
		data["paySchId"] = paySchId;
		data["paySchNo"] = paySchNo;
		data["oldDtlId"] = oldDtlId;
		console.log(JSON.stringify(data));
		var url = '<%=path%>/project/vehicle/savePrdAndPrdDetailByHC.do';
		var wait_dialog;
		$.ajax({
			type: 'post',
			dataType: 'json',
			data: data,
			url: url,
			beforeSend: function () {
				wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
			},
			success: function (msg) {
				if (msg.success == 1) {
					wait_dialog.close();
					top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
					var TAB = top.mainApp.parentTab;
					var currentTabid = TAB.getSelectedTabItemID();
					TAB.reload(currentTabid);
					var currFrameElement = top.$("#" + currentTabid).get(0);
					var callback = currFrameElement.W2W.callback;
					callback();
					top.tab.removeTabItem(currentTabid);
				} else {
					wait_dialog.close();
					UIUtils.alertError(msg.info);
				}
			}
		});
	}

	function setSplBackBankShow() {
		var isBckNo = $("#isBckNo").val();
		if (isBckNo == '1') {
			$("#splBckBankAccDiv").show();
		}
		if (isBckNo == '0') {
			$("#splBckBankAccDiv").hide();
			//设置值为空
			$("#splBackBankNoId").val("");
		}
	}

	function setSalBackBankShow() {
		var isSalBckNo = $("#isSalBckNo").val();
		if (isSalBckNo == '1') {
			$("#salBckBankAccDiv").show();
			$("#msgDiv").show();

		}
		if (isSalBckNo == '0') {
			$("#salBckBankAccDiv").hide();
			$("#msgDiv").hide();

			$("#salBackBankNoId").val("");
		}
	}

	// 初始化厂商下拉
	function initMfrComboBox() {
		$("#mfr").ligerComboBox(
				{
					url: '<%=path%>/product/mfrInfo/searchList.do',
					valueField: 'id',
					textField: 'mfrNm',
					selectBoxWidth: 200,
					autocomplete: function (e) {
						filter_autoComboboxData(e.key, this);
						e.show();
					}, keySupport: true, onChangeValue: function (value) {
						var mfrId = liger.get("mfr").getValue();
						$("#mfrId").val(mfrId);
						$("#mfrNm").val(value);
					},
					width: 200
				}
		);
	}

	function getCstInfoList() {
		var receiveTypeCd = $("#receiveTypeCd").val();
		if (receiveTypeCd == '') {
			$.ligerDialog.error("收款方类型不能为空");
			return false;
		}
		var cstRlTyp = '';
		if (receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_CZR) {
			cstRlTyp = 1
		} else if (receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_DBR) {
			cstRlTyp = 2
		}
		/*if (prjTypCd == 'CDDYWYQ') {
			cstRlTyp = 1;
		}*/
		COMBO_CST.grid.loadServerData({"prjId": '${prjId}', "cstRlTyp": cstRlTyp});
	}

	function getCstBankInfoList() {
		COMBO_CST_BANK.grid.loadServerData({"cstId": liger.get("cstSplId").selectedValue});
	}
	/*function getCstSplBankNo(){
		COMBO_CST_BANK.setInputValue(comboGrid_defaultValue7, comboGrid_defaultText7, true);
	}*/
</script>
<div class="ClearLine"></div>
</body>
</html>
